<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Flex ul</title>
    <style>
        ul.nav {
            display: flex;
            padding: 5px;
            border: 1px dashed;
        }

        ul.nav>li {
            width: 100px;
            height: 100px;
            background-color: #8cacea;
            margin: 8px;
            list-style: none;
        }
    </style>
</head>

<body>
    <ul class="nav">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>
</body>

</html>